import request from "../utils/request";

export class Product{
  static downPic = ()=>request({
    url:"/product/downpropic",
  })

  static list = ()=>request({
    url:"/product/prolist",
    method:"get",
  })

  static find = (id:String)=>request({
    url:"/product/select/",
    method:"post",
    data:{
      id
    }
  })

  static add = (obj:any)=>request({
    url:"/shopcart/add",
    method:"post",
    data:{
      id:obj.id,
      productname:obj.proname,
      productcount:1,
      attr:obj.img,
      price:obj.price,
      username:obj.username
    }
  })

  static select = (obj:any)=>request({
    url:"/shopcart//ashoplist",
    method:"post",
    data:{
      username:obj.username
    }
  })
  
  static updateCar = (obj:any)=>request({
    url:"/shopcart/update",
    method:"post",
    data:{
      id:obj.id,
      username:obj.username,
      productname:obj.productname,
      productcount:obj.count + 1
    }
  })

}